home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / k.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  766b  |  26 lines

  1. /* BKEYBRD.C: This program prints a message on the screen until the
  2.  * right SHIFT key is pressed.
  3.  */
  4.  
  5. #include <bios.h>
  6. #include <conio.h>
  7. #include <stdio.h>
  8.  
  9. void main()
  10. {
  11.    unsigned x;
  12.    int i;
  13.    printf( "Use the right SHIFT key to stop this message\n" );
  14.    while( !((x = _bios_keybrd( _NKEYBRD_SHIFTSTATUS )) & 0001))  {
  15.            if (!(x & 0001)) printf("Left shift\n"); 
  16.            if (!(x & 0002)) printf("^ key\n"); 
  17.            if (!(x & 0003)) printf("Alt \n"); 
  18.            if (!(x & 0007)) printf("In insert mode\n"); 
  19.            if (!(x & 0x08)) printf("Left ^\n"); 
  20.            if (!(x & 0x09)) printf("Left Alt\n"); 
  21.            if (!(x & 0x0A)) printf("Right ^\n"); 
  22.            if (!(x & 0x0B)) printf("Right Alt\n"); 
  23.            i = getch(); if (i == 0) i = getch();
  24.            }
  25. }
  26.